//
//  PostViewController.h
//  ViewPoint
//
//  Created by Demiao Lin on 10/23/08.
//  Copyright 2008 Tsinghua. All rights reserved.
//

#import <UIKit/UIKit.h>

#define kpostPrevious	1
#define kpostNext		2
#define kfirstThread	3
#define kthreadPrevious	4
#define kthreadNext		5

@class Board;
@class NewSMTH;

@interface PostViewController : UIViewController {
	Board *board;
    NSInteger *thread_id;
	NSInteger *post_id;
	NSString *post_type;
	
	UIView *contentView;
	UIWebView *webView;
	//UITextView *textView;
    
	NewSMTH *smth;
}

@property (nonatomic, retain) Board *board;
@property (nonatomic) NSInteger *thread_id;
@property (nonatomic) NSInteger *post_id;
@property (nonatomic, retain) NSString *post_type;

@property (nonatomic, retain) UIView *contentView;
@property (nonatomic, retain) UIWebView *webView;
//@property (nonatomic, retain) UITextView *textView;

-(void) setViewWithTitle:(NSString*)title board:(Board*)b;

-(void) setPostViewWithTitle:(NSString*)title 
					   board:(Board*)b 
					 post_id:(NSInteger*)pid 
				   post_type:(NSString*)type;

-(void) setPostViewWithPostId:(NSInteger*)pid 
                    post_type:(NSString*)type;

-(void) setPostViewWithThreadId:(NSInteger*)tid
						post_id:(NSInteger*)pid 
					  post_type:(NSString*)type;

-(void) loadContentWithURL:(NSString*)url;

-(void) loadPostViewData:(id)object;

-(void) loadToolbar;
-(void) loadPostView;
-(void) loadPostViewAsynchronously;

-(void) goToPrevious:(id)sender;
-(void) goToNext:(id)sender;
-(void) goToFirstThread:(id)sender;
-(void) goToThreadPrevious:(id)sender;
-(void) goToThreadNext:(id)sender;

-(void) toggleToolbarItemsEnabled;
-(void) toggleToolbarAndNavBar;
-(void) hideToolbarAndNavBar;

- (void) setViewsRotation;

@end


@interface PostView : UIView {
    PostViewController *controller;
	NSInteger touchType;
}

@property (nonatomic, retain) PostViewController *controller;
@property (nonatomic) NSInteger touchType;

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;

//- (void) didMoveToSuperview;

@end